package cn.itsource.controller;



import cn.itsource.basic.domain.BaseQuery;
import cn.itsource.basic.domain.JSONResult;

import cn.itsource.dto.ShopDTO;

import cn.itsource.service.ShopService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

@RestController
@RequestMapping("shop")
public class ShopController {
    @Autowired
    ShopService shopService;



    /**
    *1.请求方式: post
    *2.url: /shop/register
    *3.请求参数: shopDTO
    *4.响应参数:
    **/
    @PostMapping("register")
    public JSONResult register(@RequestBody @Valid ShopDTO shopDTO){

        return shopService.register(shopDTO);

    }

    @GetMapping("shopTypes")
    public JSONResult shopTypes(){
        //shopService.autoState(shopDTO);
        return shopService.shopTypes();

    }
    @GetMapping("combos")
    public JSONResult combos(){
        //shopService.autoState(shopDTO);
        return shopService.combos();

    }

    @GetMapping("autoState/{uuid}")
    public String autoState(@PathVariable String uuid){
        //shopService.autoState(shopDTO);
         return shopService.autoState(uuid);

    }

}
